
#ifndef __PPC_TIMER__
#define __PPC_TIMER__
#include "CCFC2011BC.h"
#include "console.h"

#define TCR   340
#define TSR   336
#define TBU_W 285
#define TBL_W 284
#define TBU 269
#define TBL 268
#define HID0 1008
#define HZ  (64*1000*1000)
#define MHZ (64)

// read $data from $spr index
#define MFSPR(data,spr) asm volatile("mfspr %0,%1" : "=r" (data) : "n" (spr))
// write $data to $spr index
#define MTSPR(spr,data) asm volatile("mtspr %0,%1" : : "n" (spr), "r" (data))


#define PSRPRITF ee_printf
extern float get_tb(void);
extern float get_tb_f(void);
void set_time_base(unsigned int tbu,unsigned int tbl);
#endif
